package grisar.gris.struct.bound;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import grisar.gris.struct.I_Bounding;
import grisar.gris.struct.I_GameObject;

public class BoundCircle implements I_Bounding{

	private int radius;
	private I_GameObject gObj;
	private Paint paint = new Paint();
	
	public BoundCircle(I_GameObject gObj, int radius){
		
		paint.setAlpha(50);
		paint.setColor(Color.RED);
		this.radius = radius;
		this.gObj = gObj;
	}
	
	//@Override
	public boolean isColliding(I_Bounding bound) {
		
		return BoundHelper.isColliding(this, bound);
	}

	//@Override
	public Point getPosition() {
	
		return gObj.getPosition();
	}

	//@Override
	public void setPosition(Point pos) {
		
		gObj.setPosition(pos);
		
	}
	
	public int getRadius(){
		return radius;
	}

	//@Override
	public void draw(Canvas canvas) {
		
		canvas.drawCircle(gObj.getPosition().x, gObj.getPosition().y, radius, paint);
	}

	//@Override
	public I_Bounding getBounding() {

		return this;
	}

}
